package edu.zut.pojo;

import java.util.List;

public class Page<T> {
    private int currentPage;//当前页
    private int size;//每页查询多少条数据
    private int count;//总共多少条数据
    private int pageCount;//总共几页数据

    private List<T> list; //分页查询的记录

    //后期可以将分页查询的依据，也封装到此处

    public int getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(int currentPage) {
        this.currentPage = currentPage;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public int getPageCount() {
        if (count % size == 0){
            pageCount = count / size;
        }else {
            pageCount = count /size + 1;
        }
        return pageCount;
    }

    public void setPageCount(int pageCount) {
        this.pageCount = pageCount;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }
}
